<?php
/*
function test()
{
    return 25;
}

$foo = "hello";
$bar = &$foo;
$bar = "world";
echo "$foo, $bar";
$x = &test();
echo "$x";
 */
?>

<?php

/*var_dump($unset_var);
echo ($unset_bool ? "true\n" : "false\n");
$unset_str .= "abc";
var_dump($unset_str);
$unset_arr[3] = "def"; var_dump($unset_arr);
$unset_obj->foo = 'bar'; var_dump($unset_obj);*/

/*$a = 'hello';
$$a = 'world';
$$$a = '!';
echo "$a ${$a} ${${$a}}" . "<br/>";
echo "$a $hello $world" . "<br/>";

$b = array("One", "Two", "Three");
$$b[1] = "vv";
echo "${$b}[1]" . "<br/>";
echo "${$b[1]}" . "<br/>";*/

/*$a = 3;
$b = 2;
//include './var.inc.php';
function test_var_scope()
{
    #if 0
    global $a, $b;
    $b = $b + $a;
    #else
    $GLOBALS['b'] = $GLOBALS['b'] + $GLOBALS['a'];
    #endif
}

test_var_scope();
echo "\$b is $b" . "<br/>";*/

/*
function test_super_globals()
{
    global $HTTP_GET_VARS;
    echo "HTTP_GET_VARS: " . $HTTP_GET_VARS['name'] . "<br/>";
    echo "_GET: " . $_GET['name'] . "<br/>";
}

test_super_globals();*/

/*function counter()
{
    static $a = 0;
    echo $a . "<br/>";
    $a++;
}

counter();
counter();
counter();
counter();
counter();*/

/*function static_recur()
{
    static $count = 0;

    $count++;
    echo "start: " . $count . "<br/>";

    if ($count < 10) {
        static_recur();
    }
    $count--;
    echo "end: " . $count . "<br/>";
}

static_recur();*/

/*function assign_static_exp()
{
    static $a = 2;

    $a++;
    echo $a;
}
assign_static_exp(); */

/*function test_global_ref()
{
    global $obj;
    $obj = &new stdclass;
    echo "in test_global_ref(): ";
    var_dump($obj);
    echo "<br/>";
}

function test_global_no_ref()
{
    global $obj;
    $obj = new stdclass;
    echo "in test_global_no_ref(): ";
    var_dump($obj);
    echo "<br/>";
}

test_global_ref();
var_dump($obj);
test_global_no_ref();
var_dump($obj);*/

$str = "I'm fine";
echo addslashes($str).'<br />';

echo 'You can also have embedded newlines in 
strings this way as it is
okay to do'.'<br />';

$str = <<<EOD
Example of string
spanning multiple lines
using heredoc syntax.
EOD;
echo $str.'<br />';

?>
